package com.dubbo.client.controller;

import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.api.DeptService;
import com.dubbo.entity.DeptDo;

@RestController
@RequestMapping("/dept")
public class DeptController {

	@Reference
	DeptService deptService;

	@GetMapping("/findById/{id}")
	public DeptDo findById(@PathVariable Long id) {
		return deptService.findById(id);
	}

	@GetMapping("/listDept")
	public List<DeptDo> listUser() {
		return deptService.deptList();
	}
}